<%@ include file="/WEB-INF/views/taglib.jsp" %>
<div class="paginationNav">
<div>
<a href="${paginationUrl}?curPage=1" class="firstNav" >first</a>
<a href="${paginationUrl}?curPage=${searchResult.curPage-1}" class="prevNav">prev</a>
<c:forEach items="${searchResult.page}" var="item">
<c:choose>
<c:when test="${item==searchResult.curPage}">
${item}
</c:when>
<c:otherwise>
<a href="${paginationUrl}?curPage=${item}">${item}</a>
</c:otherwise>
</c:choose>
</c:forEach>
<a href="${paginationUrl}?curPage=${searchResult.curPage+1}" class="nextNav">next</a>
<a href="${paginationUrl}?curPage=${searchResult.maxPage}" class="lastNav" >last</a>
</div>
<div>
Page : <b>${searchResult.curPage}/${searchResult.maxPage} - ${searchResult.resultCount} record(s) </b> 
 |
Max Row : 
<a href="${paginationUrl}?maxRow=10&curPage=1" class="row10Nav">10</a>
<a href="${paginationUrl}?maxRow=50&curPage=1" class="row50Nav">50</a>
<a href="${paginationUrl}?maxRow=100&curPage=1" class="row100Nav">100</a>
</div>
</div>

<script type="text/javascript">
	$(document).ready(function() {
		var paginationNav = $('.paginationNav');
		var curPage = '${searchResult.curPage}';
		var maxPage = '${searchResult.maxPage}';
		var maxRow = '${searchResult.searchCriteria.maxRow}';
		
		$('a.row'+maxRow+'Nav').removeAttr('href');
		$('a.row'+maxRow+'Nav').addClass('disable');
		
		if(maxPage==curPage)
		{
			$('a.lastNav,a.nextNav').removeAttr('href');
			$('a.lastNav,a.nextNav').addClass('disable');
		}
		
		if(1==curPage)
		{
			$('a.firstNav,a.prevNav').removeAttr('href');
			$('a.firstNav,a.prevNav').addClass('disable');
		}
		
		<c:if test="${popUpFlag=='Y'}">
		$('div.paginationNav').find('a').each(function(){
			this.href=this.href+'&popUpFlag=Y';
		});
		</c:if> 
		
		
		
	});
</script>
